home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume20 / dmake / patch02b < prev    next >
Encoding:
Text File  |  1991-06-29  |  38.2 KB  |  948 lines

  1. Newsgroups: comp.sources.misc
  2. From: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  3. Subject:  v20i077:  dmake - dmake version 3.7, Patch02b/12
  4. Message-ID: <1991Jun29.222504.4007@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 15645fc359d4053ff6cfe225c44a8a91
  6. Date: Sat, 29 Jun 1991 22:25:04 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  10. Posting-number: Volume 20, Issue 77
  11. Archive-name: dmake/patch02b
  12. Patch-To: dmake: Volume 19, Issue 22-58
  13.  
  14. #!/bin/sh
  15. # This is a shell archive (produced by shar 3.49)
  16. # To extract the files from this archive, save it to a file, remove
  17. # everything above the "!/bin/sh" line above, and type "sh file_name".
  18. #
  19. # made 06/28/1991 13:56 UTC by dvadura@watdragon
  20. # Source directory /u2/dvadura/src/generic/dmake/dist/addresses
  21. #
  22. # existing files will NOT be overwritten unless -c is specified
  23. #
  24. # This is part 1 of a multipart archive                                    
  25. # do not concatenate these parts, unpack them in order with /bin/sh        
  26. #
  27. # This shar contains:
  28. # length  mode       name
  29. # ------ ---------- ------------------------------------------
  30. # 404337 -rw-r----- dm37p2
  31. #
  32. if test -r _shar_seq_.tmp; then
  33.     echo 'Must unpack archives in sequence!'
  34.     echo Please unpack part `cat _shar_seq_.tmp` next
  35.     exit 1
  36. fi
  37. # ============= dm37p2 ==============
  38. if test -f 'dm37p2' -a X"$1" != X"-c"; then
  39.     echo 'x - skipping dm37p2 (File already exists)'
  40.     rm -f _shar_wnt_.tmp
  41. else
  42. > _shar_wnt_.tmp
  43. echo 'x - extracting dm37p2 (Text)'
  44. sed 's/^X//' << 'SHAR_EOF' > 'dm37p2' &&
  45. X#!/bin/sh
  46. X# dodiff:  Directory tree maintainer (v1.1)
  47. X#
  48. X# DMAKE 3.7 PATCH #2
  49. X# ------------------
  50. X# Priority:  Medium
  51. X# 
  52. X# Prerequisite:  dmake 3.7 patch level 1 full distribution.
  53. X# 
  54. X# Location:  You can obtain a copy of the patch from watmsg.uwaterloo.edu
  55. X#        via anonymous ftp from the directory pub/dmake.  The file is
  56. X#        dmake37-patch2.Z.  The patch is also submitted for posting
  57. X#        to comp.sources.misc.
  58. X# 
  59. X# Application:  Change directory to the source directory containing the
  60. X#           dmake sources and run the patch through /bin/sh.  It constructs
  61. X#           any required subdirectories and applies the patch program as
  62. X#           needed to apply patches to files.  If you obtain the patch
  63. X#           files from a news group then you must first build the patch
  64. X#           source by running all parts of the patch through unshar or
  65. X#           /bin/sh.
  66. X# 
  67. X# Acknowledgment:  Thanks to everyone who wrote with suggestions or bug fixes.
  68. X#           In most cases your fixes and/or suggestions were
  69. X#           incorporated into the sources.  Your continued input makes
  70. X#           dmake a better tool.
  71. X# 
  72. X# 
  73. X# DETAILS OF FIXES:
  74. X# -----------------
  75. X# - Fixed a bug in function.c.  If you used a $(shell ...) macro in a line
  76. X#   which got expanded from within the input buffer Buffer (eg. in a rule
  77. X#   definition) nasty things could happen since _exec_shell re-used Buffer
  78. X#   when it shouldn't have.
  79. X# 
  80. X# - Made sure that -v and -n flags do not take effect across a $(shell ...)
  81. X#   macro expansion.  This ensures that $(shell ...) recipes are always
  82. X#   executed when the macro is expanded and never contain noise from a -v
  83. X#   flag.  Dunno how I missed this the first time around.
  84. X# 
  85. X# - Fixed a bug that set Current_target to NULL when making successive recipe
  86. X#   lines individually.  This meant that temp files were being deleted late,
  87. X#   possibly from the wrong places, and hence not deleted at all.
  88. X# 
  89. X# - Fixed several inference bugs.  Nothing too major:
  90. X# 
  91. X#     1. a recipe of the form
  92. X#         %.foo:
  93. X#         @[
  94. X#            stuff ...
  95. X#         ]
  96. X#        didn't get the group recipe attribute attached to the %.foo node
  97. X#        so when the inference algorithm was run it failed to attach the
  98. X#        correct attribute to go along with the new recipe.
  99. X# 
  100. X#     2. Inference algorithm now marks for REMOVAL, ALL intermediate nodes
  101. X#        (it did this before too -- but by luck), and marks ALL nodes as
  102. X#        TARGETS, and all but the first node as being INFERRED.  I doubt
  103. X#        that anyone will notice these changes.  I had to have a really
  104. X#        screwy makefile to find the bug.
  105. X# 
  106. X# - Fixed $(shell ...) macro so that it can be nested to arbitrary depths.
  107. X#   It uses a single temporary file for the purpose and keeps reusing it for
  108. X#   each nested instance.  Works like a charm.
  109. X# 
  110. X# - Fixed bug in rulparse.c where an attribute flag variable was of type
  111. X#   int and not t_attr as it should be.  This caused problems on 16-bit
  112. X#   machines (reported by lots of people).
  113. X# 
  114. X# - Fixed a bug reported by paul@halserv2.hal.com, dmake.c line 373, would
  115. X#   dereference a NULL pointer if the hash table didn't contain an entry.
  116. X# 
  117. X# - Fixed a bug reported by paul@halserv2.hal.com, rulparse.c line 949
  118. X#   would dereference a NULL pointer if it tried to match a certain sequence
  119. X#   of %-meta rules.
  120. X# 
  121. X# - Fixed a bug reported by paul@halserv2.hal.com, make.c, the SET_TOKEN
  122. X#   call was getting called with a NULL pointer.
  123. X# 
  124. X# - Minor tweaks to the OS/2 scripts as reported by Frank Waley.  Should make
  125. X#   MSC compiles work now.
  126. X# 
  127. X# - Changed sysvr4/stdarg.h to ensure that va_dcl is defined.
  128. X# 
  129. X# - Modified man page.  The diffs would have been bigger than the source so
  130. X#   I just included new copies.
  131. X# 
  132. X# 
  133. X# 
  134. X# DETAILS OF ADDITIONS/CHANGES:
  135. X# -----------------------------
  136. X# - Added a sysvr3/pwd directory along with getcwd.c.  The reason for this
  137. X#   addition is to hopefully eliminate once and for all the annoying
  138. X#   "lost a child" bug.  If you see this bug appear then remake dmake with
  139. X# 
  140. X#     make sysvr3pwd
  141. X#     or  make xenixpwd
  142. X# 
  143. X#   Both create a version of dmake that uses a local version of getcwd rather
  144. X#   than the C-library version.  Thanks to Gwyn Dyer for providing the code
  145. X#   to getcwd.c.  I used his version as it compiled on a xenix machine and
  146. X#   seemed to be the more widely used one.  Thanks to all that sent me copies
  147. X#   of it.  I hope this gets rid of the lost child issue once and for all.
  148. X# 
  149. X# - The MSDOS version now behaves identically to the UNIX versions when
  150. X#   running recipes containing embedded cd calls.  I changed dmake to restore
  151. X#   the directory it was in prior to invoking a child process.
  152. X# 
  153. X#   The following recipe will now behave identically under UNIX and DOS
  154. X# 
  155. X#       all:
  156. X#         cd foo; make ...
  157. X#         cd fee; make ...
  158. X# 
  159. X#   Previously to this change, the DOS version of DMAKE would have been in
  160. X#   the foo directory after the first line of the recipe, and would not
  161. X#   find fee.
  162. X# 
  163. X# - Added the -B flag.  This is in response to several requests at supporting
  164. X#   spaces in front of recipe lines.  This does not come without a price.
  165. X#   By default the flag is off and tabs are required to start recipe lines
  166. X#   unless it is a group recipe.  If you turn the flag on, either through
  167. X#   supplying -B on the command line or by putting ".NOTABS := y" in the
  168. X#   makefile then when dmake scans non-group recipes they are terminated at
  169. X#   the first line that is only white space or contains no leading white space
  170. X#   and is either a macro definition or a rule definition.
  171. X# 
  172. X#   Consider the following makefile:
  173. X# 
  174. X#       all:
  175. X#     <tab>  echo hi there
  176. X#     <space>echo e:test
  177. X#     <tab>  echo hello
  178. X# 
  179. X#   By default the recipe for all is simply: "echo hi there", and the remaining
  180. X#   two lines are parsed as a new rule definition with the associated recipe
  181. X#   being "echo hello".  If you supply -B, then the recipe for 'all' is all
  182. X#   three lines above, since the second recipe line now begins with a space.
  183. X#   
  184. X#   If you change the makefile to contain:
  185. X# 
  186. X#       all:
  187. X#     <tab>  echo hi there
  188. X# 
  189. X#     <space>echo e:test
  190. X#     <tab>  echo hi there
  191. X# 
  192. X#   then the -B flag has no visible effect.  The makefile is parsed the
  193. X#   same in both cases as the first recipe is terminated by the empty line.
  194. X#   or a valid recipe rule.
  195. X# 
  196. X#   If you now change the makefile to contain:
  197. X# 
  198. X#       all:
  199. X#     <tab>  echo hi there
  200. X# 
  201. X#     <tab>  echo e:test
  202. X#     <tab>  echo hi there
  203. X# 
  204. X#   then by default all three lines form the recipe for 'all'.
  205. X#   Specifying -B terminates the first recipe after the first line and begins
  206. X#   a new rule definition with the line "echo e:test".
  207. X# 
  208. X#   In summary:
  209. X#       By default:  (no -B) a recipe is terminated by a line containing some
  210. X#            text that does not begin with a <tab>.
  211. X# 
  212. X#       Specify -B:  A recipe is terminated by a line that is only white space
  213. X#            or by a line containg text that contains NO leading
  214. X#            white space.
  215. X# 
  216. X#   You can use the .NOTABS macro to set/reset this behaviour at will from
  217. X#   within a makefile.  See the man page.
  218. X# 
  219. X# - Added OSRELEASE=coherent targets and directories to support Coherent
  220. X#   systems.  Patches provided by David Fenyes (dfenyes@thesis1.med.uth.tmc.edu).
  221. X# 
  222. X# - Added OSRELEASE=msdos OSENVIRONMENT=ztcdos targets and directories to
  223. X#   support making of dmake using Zortech C++ 2.1.  Patches provided by
  224. X#   David Engel (ods@utdallas.edu).
  225. X#
  226. X# Remove Obsolete files from distribution
  227. X
  228. X# Now use a shar archive to add any new files to the distribution
  229. X# This is a shell archive (produced by shar 3.49)
  230. X# To extract the files from this archive, save it to a file, remove
  231. X# everything above the "!/bin/sh" line above, and type "sh file_name".
  232. X#
  233. X# made 06/28/1991 13:27 UTC by dvadura@watdragon
  234. X# Source directory /u2/dvadura/src/generic/dmake/src
  235. X#
  236. X# existing files will NOT be overwritten unless -c is specified
  237. X#
  238. X# This shar contains:
  239. X# length  mode       name
  240. X# ------ ---------- ------------------------------------------
  241. X# 125864 -rw-r----- man/dmake.p
  242. X#  98450 -r--r----- man/dmake.tf
  243. X#   1976 -r--r----- msdos/ztcdos/config.h
  244. X#   1990 -rw-r----- msdos/ztcdos/config.mk
  245. X#    473 -r--r----- msdos/ztcdos/environ.c
  246. X#      1 -rw-r----- msdos/ztcdos/lib.rsp
  247. X#      1 -rw-r----- msdos/ztcdos/libswp.rsp
  248. X#   3232 -rw-r----- msdos/ztcdos/mk.bat
  249. X#   3235 -rw-r----- msdos/ztcdos/mkswp.bat
  250. X#    614 -rw-r----- msdos/ztcdos/obj.rsp
  251. X#    626 -rw-r----- msdos/ztcdos/objswp.rsp
  252. X#   5417 -rw-r----- msdos/ztcdos/public.h
  253. X#   3861 -rw-r----- msdos/ztcdos/startup.mk
  254. X#   1738 -r--r----- msdos/ztcdos/tempnam.c
  255. X#   1940 -r--r--r-- unix/coherent/config.h
  256. X#    765 -rw-r--r-- unix/coherent/config.mk
  257. X#    306 -r--r--r-- unix/coherent/getcwd.c
  258. X#   2405 -rw-r--r-- unix/coherent/make.sh
  259. X#   5318 -rw-r----- unix/coherent/public.h
  260. X#   3221 -rw-r--r-- unix/coherent/startup.mk
  261. X#    469 -r--r--r-- unix/coherent/stdarg.h
  262. X#    346 -r--r--r-- unix/coherent/stdlib.h
  263. X#    133 -r--r--r-- unix/coherent/time.h
  264. X#   4312 -r--r--r-- unix/coherent/vfprintf.c
  265. X#    559 -rw-r----- unix/sysvr3/pwd/config.mk
  266. X#   5834 -r--r----- unix/sysvr3/pwd/getcwd.c
  267. X#   2739 -rw-r----- unix/sysvr3/pwd/make.sh
  268. X#   5318 -rw-r----- unix/sysvr3/pwd/public.h
  269. X#   3221 -rw-r----- unix/sysvr3/pwd/startup.mk
  270. X#
  271. X# ============= man/dmake.p ==============
  272. Xif test ! -d 'man'; then
  273. X    echo 'x - creating directory man'
  274. X    mkdir 'man'
  275. Xfi
  276. Xif test -f 'man/dmake.p' -a X != X; then
  277. X    echo 'x - skipping man/dmake.p (File already exists)'
  278. Xelse
  279. Xecho 'x - extracting man/dmake.p (Text)'
  280. Xsed 's/^X//' << 'SHAR_EOF' > 'man/dmake.p' &&
  281. XX
  282. XX
  283. XX
  284. XX
  285. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  286. XX
  287. XX
  288. XX
  289. XNNAAMMEE
  290. XX     ddmmaakkee - maintain program groups, or interdependent files
  291. XX
  292. XSSYYNNOOPPSSIISS
  293. XX     ddmmaakkee [-ABceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K}
  294. XX     file] [macro[*][+][:]=_v_a_l_u_e ...] [target ...]
  295. XX
  296. XDDEESSCCRRIIPPTTIIOONN
  297. XX     ddmmaakkee executes commands found in an external file called a
  298. XX     _m_a_k_e_f_i_l_e to update one or more target names.  Each target
  299. XX     may depend on zero or more prerequisite targets.  If any of
  300. XX     the target's prerequisites is newer than the target or if
  301. XX     the target itself does not exist, then ddmmaakkee will attempt to
  302. XX     make the target.
  303. XX
  304. XX     If no --ff command line option is present then ddmmaakkee searches
  305. XX     for an existing _m_a_k_e_f_i_l_e from the list of prerequisites
  306. XX     specified for the special target _._M_A_K_E_F_I_L_E_S (see the STARTUP
  307. XX     section for more details).  If "-" is the name of the file
  308. XX     specified to the --ff flag then ddmmaakkee uses standard input as
  309. XX     the source of the makefile text.
  310. XX
  311. XX     Any macro definitions (arguments with embedded "=" signs)
  312. XX     that appear on the command line are processed first and
  313. XX     supersede definitions for macros of the same name found
  314. XX     within the makefile.  In general it is impossible for defin-
  315. XX     itions found inside the makefile to redefine a macro defined
  316. XX     on the command line, see the MACROS section for an excep-
  317. XX     tion.
  318. XX
  319. XX     If no _t_a_r_g_e_t names are specified on the command line, then
  320. XX     ddmmaakkee uses the first non-special target found in the
  321. XX     makefile as the default target.  See the SSPPEECCIIAALL TTAARRGGEETTSS
  322. XX     section for the list of special targets and their function.
  323. XX     ddmmaakkee is a re-implementation of the UNIX Make utility with
  324. XX     significant enhancements.  Makefiles written for most previ-
  325. XX     ous versions of _M_a_k_e will be handled correctly by ddmmaakkee..
  326. XX     Known differences between ddmmaakkee and other versions of make
  327. XX     are discussed in the CCOOMMPPAATTIIBBIILLIITTYY section found at the end
  328. XX     of this document.
  329. XX
  330. XOOPPTTIIOONNSS
  331. XX     --AA   Enable AUGMAKE special inference rule transformations
  332. XX          (see the "PERCENT(%) RULES" section), these are set to
  333. XX          off by default.
  334. XX
  335. XX     --BB   Enable the use of spaces instead of <tabs> to begin
  336. XX          recipe lines.  This flag equivalent to the .NOTABS spe-
  337. XX          cial macro and is further described below.
  338. XX
  339. XX     --cc   Use non-standard comment stripping.  If you specify --cc
  340. XX          then ddmmaakkee will treat any ## character as a start of
  341. XX
  342. XX
  343. XX
  344. XVersion 3.70                    UW                              1
  345. XX
  346. XX
  347. XX
  348. XX
  349. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  350. XX
  351. XX
  352. XX
  353. XX          comment character wherever it may appear unless it is
  354. XX          escaped by a \.
  355. XX
  356. XX     --CC [[++]]ffiillee
  357. XX          This option writes to _f_i_l_e a copy of standard output
  358. XX          and standard error from any child processes and from
  359. XX          the ddmmaakkee process itself.  If you specify a ++ prior to
  360. XX          the file name then the text is appended to the previous
  361. XX          contents of _f_i_l_e.  This option is active in the MSDOS
  362. XX          implementation only and is ignored by non-MSDOS ver-
  363. XX          sions of ddmmaakkee..
  364. XX
  365. XX     --ee   Read the environment and define all strings of the form
  366. XX          'EENNVV--VVAARR=_e_v_a_l_u_e' defined within as macros whose name is
  367. XX          EENNVV--VVAARR, and whose value is '_e_v_a_l_u_e'.  The environment
  368. XX          is processed prior to processing the user specified
  369. XX          makefile thereby allowing definitions in the makefile
  370. XX          to override definitions in the environment.
  371. XX
  372. XX     --EE   Same as -e, except that the environment is processed
  373. XX          after the user specified makefile has been processed
  374. XX          (thus definitions in the environment override defini-
  375. XX          tions in the makefile).  The -e and -E options are
  376. XX          mutually exclusive.  If both are given the latter takes
  377. XX          effect.
  378. XX
  379. XX     --ff ffiillee
  380. XX          Use ffiillee as the source for the makefile text.  Only one
  381. XX          --ff option is allowed.
  382. XX
  383. XX     --hh   Print the command summary for ddmmaakkee.
  384. XX
  385. XX     --ii   Tells ddmmaakkee to ignore errors, and continue making other
  386. XX          targets.  This is equivalent to the .IGNORE attribute
  387. XX          or macro.
  388. XX
  389. XX     --KK ffiillee
  390. XX          Turns on ..KKEEEEPP__SSTTAATTEE state tracking and tells ddmmaakkee to
  391. XX          use _f_i_l_e as the state file.
  392. XX
  393. XX     --kk   Causes ddmmaakkee to ignore errors caused by command execu-
  394. XX          tion and to make all targets not depending on targets
  395. XX          that could not be made. Ordinarily ddmmaakkee stops after a
  396. XX          command returns a non-zero status, specifying --kk causes
  397. XX          ddmmaakkee to ignore the error and continue to make as much
  398. XX          as possible.
  399. XX
  400. XX     --nn   Causes ddmmaakkee to print out what it would have executed,
  401. XX          but does not actually execute the commands.  A special
  402. XX          check is made for the string "$(MAKE)" inside a recipe
  403. XX          line, if found, the line is expanded and invoked,
  404. XX          thereby enabling recursive makes to give a full
  405. XX
  406. XX
  407. XX
  408. XVersion 3.70                    UW                              2
  409. XX
  410. XX
  411. XX
  412. XX
  413. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  414. XX
  415. XX
  416. XX
  417. XX          description of all that they will do.  The check for
  418. XX          "$(MAKE)" is disabled inside group recipes.
  419. XX
  420. XX     --pp   Print out a version of the digested makefile in human
  421. XX          readable form.  (useful for debugging, but cannot be
  422. XX          re-read by ddmmaakkee)
  423. XX
  424. XX     --PP##  On systems that support multi-processing cause ddmmaakkee to
  425. XX          use _# concurrent child processes to make targets.  See
  426. XX          the "MULTI PROCESSING" section for more information.
  427. XX
  428. XX     --qq   Check and see if the target is up to date.  Exits with
  429. XX          code 0 if up to date, 1 otherwise.
  430. XX
  431. XX     --rr   Tells ddmmaakkee not to read the initial startup makefile,
  432. XX          see STARTUP section for more details.
  433. XX
  434. XX     --ss   Tells ddmmaakkee to do all its work silently and not echo
  435. XX          the commands it is executing to stdout (also suppresses
  436. XX          warnings).  This  is equivalent to the .SILENT attri-
  437. XX          bute or macro.
  438. XX
  439. XX     --SS   Force sequential execution of recipes on architectures
  440. XX          which support concurrent makes.  For backward compati-
  441. XX          bility with old makefiles that have nasty side-effect
  442. XX          prerequisite dependencies.
  443. XX
  444. XX     --tt   Causes ddmmaakkee to touch the targets and bring them up to
  445. XX          date without executing any commands.
  446. XX
  447. XX     --TT   Tells ddmmaakkee to not perform transitive closure on the
  448. XX          inference graph.
  449. XX
  450. XX     --uu   Force an unconditional update.  (ie. do everything that
  451. XX          would be done if everything that a target depended on
  452. XX          was out of date)
  453. XX
  454. XX     --vv[[ddffiimmtt]]
  455. XX          Verbose flag, when making targets print to stdout what
  456. XX          we are going to make and what we think its time stamp
  457. XX          is.  The optional flags [[ddffiimmtt]] can be used to restrict
  458. XX          the information that is displayed.  In the absence of
  459. XX          any optional flags all are assumed to be given (ie. --vv
  460. XX          is equivalent to --vvddffiimmtt).  The meanings of the
  461. XX          optional flags are:
  462. XX
  463. XX          dd    Notify of change directory operations only.
  464. XX
  465. XX          ff    Notify of file I/O operations only.
  466. XX
  467. XX          ii    Notify of inference algorithm operation only.
  468. XX
  469. XX
  470. XX
  471. XX
  472. XVersion 3.70                    UW                              3
  473. XX
  474. XX
  475. XX
  476. XX
  477. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  478. XX
  479. XX
  480. XX
  481. XX          mm    Notify of target update operations only.
  482. XX
  483. XX          tt    Keep any temporary files created; normally they
  484. XX               are automatically deleted.
  485. XX
  486. XX     --VV   Print the version of ddmmaakkee, and values of builtin mac-
  487. XX          ros.
  488. XX
  489. XX     --xx   Upon processing the user makefile export all non-
  490. XX          internally defined macros to the user's environment.
  491. XX          This option together with the -e option allows SYSV
  492. XX          AUGMAKE recursive makes to function as expected.
  493. XX
  494. XIINNDDEEXX
  495. XX     Here is a list of the sections that follow and a short
  496. XX     description of each.  Perhaps you won't have to read the
  497. XX     whole man page to find what you need.
  498. XX
  499. XX     SSTTAARRTTUUPP            Describes ddmmaakkee initialization.
  500. XX
  501. XX     SSYYNNTTAAXX             Describes the syntax of makefile expres-
  502. XX                        sions.
  503. XX
  504. XX     AATTTTRRIIBBUUTTEESS         Describes the notion of attributes and
  505. XX                        how they are used when making targets.
  506. XX
  507. XX     MMAACCRROOSS             Defining and expanding macros.
  508. XX
  509. XX     RRUULLEESS AANNDD TTAARRGGEETTSS  How to define targets and their prere-
  510. XX                        quisites.
  511. XX
  512. XX     RREECCIIPPEESS            How to tell ddmmaakkee how to make a target.
  513. XX
  514. XX     TTEEXXTT DDIIVVEERRSSIIOONNSS    How to use text diversions in recipes and
  515. XX                        macro expansions.
  516. XX
  517. XX     SSPPEECCIIAALL TTAARRGGEETTSS    Some targets are special.
  518. XX
  519. XX     SSPPEECCIIAALL MMAACCRROOSS     Macros used by ddmmaakkee to alter the pro-
  520. XX                        cessing of the makefile, and those
  521. XX                        defined by ddmmaakkee for the user.
  522. XX
  523. XX     CCOONNTTRROOLL MMAACCRROOSS     Itemized list of special control macros.
  524. XX
  525. XX     RRUUNN--TTIIMMEE MMAACCRROOSS    Discussion of special run-time macros
  526. XX                        such as $@ and $<.
  527. XX
  528. XX     FFUUNNCCTTIIOONN MMAACCRROOSS    GNU style function macros, only $(mktmp
  529. XX                        ...) for now.
  530. XX
  531. XX     DDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
  532. XX                        Processing of prerequisites which contain
  533. XX
  534. XX
  535. XX
  536. XVersion 3.70                    UW                              4
  537. XX
  538. XX
  539. XX
  540. XX
  541. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  542. XX
  543. XX
  544. XX
  545. XX                        macro expansions in their name.
  546. XX
  547. XX     BBIINNDDIINNGG TTAARRGGEETTSS    The rules that ddmmaakkee uses to bind a tar-
  548. XX                        get to an existing file in the file sys-
  549. XX                        tem.
  550. XX
  551. XX     PPEERRCCEENNTT((%%)) RRUULLEESS   Specification of recipes to be used by
  552. XX                        the inference algorithm.
  553. XX
  554. XX     MMAAKKIINNGG IINNFFEERREENNCCEESS  The rules that ddmmaakkee uses when inferring
  555. XX                        how to make a target which has no expli-
  556. XX                        cit recipe.  This and the previous sec-
  557. XX                        tion are really a single section in the
  558. XX                        text.
  559. XX
  560. XX     MMAAKKIINNGG TTAARRGGEETTSS     How ddmmaakkee makes targets other than
  561. XX                        libraries.
  562. XX
  563. XX     MMAAKKIINNGG LLIIBBRRAARRIIEESS   How ddmmaakkee makes libraries.
  564. XX
  565. XX     KKEEEEPP SSTTAATTEE         A discussion of how .KEEP_STATE works.
  566. XX
  567. XX     MMUULLTTII PPRROOCCEESSSSIINNGG   Discussion of ddmmaakkee''ss parallel make
  568. XX                        facilities for architectures that support
  569. XX                        them.
  570. XX
  571. XX     CCOONNDDIITTIIOONNAALLSS       Conditional expressions which control the
  572. XX                        processing of the makefile.
  573. XX
  574. XX     EEXXAAMMPPLLEESS           Some hopefully useful examples.
  575. XX
  576. XX     CCOOMMPPAATTIIBBIILLIITTYY      How ddmmaakkee compares with previous versions
  577. XX                        of make.
  578. XX
  579. XX     LLIIMMIITTSS             Limitations of ddmmaakkee.
  580. XX
  581. XX     PPOORRTTAABBIILLIITTYY        Comments on writing portable makefiles.
  582. XX
  583. XX     FFIILLEESS              Files used by ddmmaakkee.
  584. XX
  585. XX     SSEEEE AALLSSOO           Other related programs, and man pages.
  586. XX
  587. XX     AAUUTTHHOORR             The guy responsible for this thing.
  588. XX
  589. XX     BBUUGGSS               Hope not.
  590. XX
  591. XSSTTAARRTTUUPP
  592. XX     When ddmmaakkee begins execution it first processes the command
  593. XX     line and then processes an initial startup-makefile.  This
  594. XX     is followed by an attempt to locate and process a user sup-
  595. XX     plied makefile.  The startup file defines the default values
  596. XX     of all required control macros and the set of default rules
  597. XX
  598. XX
  599. XX
  600. XVersion 3.70                    UW                              5
  601. XX
  602. XX
  603. XX
  604. XX
  605. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  606. XX
  607. XX
  608. XX
  609. XX     for making targets and inferences.  When searching for the
  610. XX     startup makefile, ddmmaakkee searches the following locations, in
  611. XX     the order specified, until a startup file is located:
  612. XX
  613. XX          1.   The location given as the value of the macro MAK-
  614. XX               ESTARTUP defined on the command line.
  615. XX
  616. XX          2.   The location given as the value of the environment
  617. XX               variable MAKESTARTUP defined in the current
  618. XX               environment.
  619. XX
  620. XX          3.   The location given as the value of the macro MAK-
  621. XX               ESTARTUP defined internally within ddmmaakkee.
  622. XX
  623. XX     The above search is disabled by specifying the -r option on
  624. XX     the command line.  An error is issued if a startup makefile
  625. XX     cannot be found and the -r option was not specified.  A user
  626. XX     may substitute a custom startup file by defining the MAKES-
  627. XX     TARTUP environment variable or by redefining the MAKESTARTUP
  628. XX     macro on the command line.  To determine where ddmmaakkee looks
  629. XX     for the default startup file, check your environment or
  630. XX     issue the command _"_d_m_a_k_e _-_V_".
  631. XX
  632. XX     A similar search is performed to locate a default user
  633. XX     makefile when no --ff command line option is specified.  By
  634. XX     default, the prerequisite list of the special target
  635. XX     .MAKEFILES specifies the names of possible makefiles and the
  636. XX     search order that ddmmaakkee should use to determine if one
  637. XX     exists.  A typical definition for this target is:
  638. XX
  639. XX          .MAKEFILES : makefile.mk Makefile makefile
  640. XX
  641. XX     ddmmaakkee will first look for makefile.mk and then the others.
  642. XX     If a prerequisite cannot be found ddmmaakkee will try to make it
  643. XX     before going on to the next prerequisite.  For example,
  644. XX     makefile.mk can be checked out of an RCS file if the proper
  645. XX     rules for doing so are defined in the startup file.
  646. XX
  647. XSSYYNNTTAAXX
  648. XX     This section is a summary of the syntax of makefile state-
  649. XX     ments.  The description is given in a style similar to BNF,
  650. XX     where { } enclose items that may appear zero or more times,
  651. XX     and [ ] enclose items that are optional.  Alternative pro-
  652. XX     ductions for a left hand side are indicated by '->', and
  653. XX     newlines are significant.  All symbols in bboolldd type are text
  654. XX     or names representing text supplied by the user.
  655. XX
  656. XX
  657. XX
  658. XX          Makefile -> { Statement }
  659. XX
  660. XX
  661. XX
  662. XX
  663. XX
  664. XVersion 3.70                    UW                              6
  665. XX
  666. XX
  667. XX
  668. XX
  669. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  670. XX
  671. XX
  672. XX
  673. XX          Statement -> Macro-Definition
  674. XX                    -> Conditional
  675. XX                    -> Rule-Definition
  676. XX                    -> Attribute-Definition
  677. XX
  678. XX          Macro-Definition -> MMAACCRROO == LLIINNEE
  679. XX                           -> MMAACCRROO **== LLIINNEE
  680. XX                           -> MMAACCRROO ::== LLIINNEE
  681. XX                           -> MMAACCRROO **::== LLIINNEE
  682. XX                           -> MMAACCRROO ++== LLIINNEE
  683. XX                           -> MMAACCRROO ++::== LLIINNEE
  684. XX
  685. XX          Conditional ->  ..IIFF expression
  686. XX                             Makefile
  687. XX                          [ ..EELLIIFF expression
  688. XX                             Makefile ]
  689. XX                          [ ..EELLSSEE
  690. XX                             Makefile ]
  691. XX                          ..EENNDD
  692. XX
  693. XX          expression -> LLIINNEE
  694. XX                     -> SSTTRRIINNGG ==== LLIINNEE
  695. XX                     -> SSTTRRIINNGG !!== LLIINNEE
  696. XX
  697. XX
  698. XX          Rule-Definition ->  target-definition
  699. XX                                 [ recipe ]
  700. XX
  701. XX          target-definition -> targets [attrs] op { PPRREERREEQQUUIISSIITTEE } [;; rcp-line]
  702. XX
  703. XX          targets -> target { targets }
  704. XX                  -> ""target"" { targets }
  705. XX
  706. XX          target -> special-target
  707. XX                 -> TTAARRGGEETT
  708. XX
  709. XX          attrs -> attribute { attrs }
  710. XX                -> ""attribute"" { attrs }
  711. XX
  712. XX          op -> :: { modifier }
  713. XX
  714. XX          modifier -> ::
  715. XX                   -> ^^
  716. XX                   -> !!
  717. XX                   -> --
  718. XX
  719. XX          recipe -> { TTAABB rcp-line }
  720. XX                 -> [@@][%%][--] [[
  721. XX                       { LLIINNEE }
  722. XX                    ]]
  723. XX
  724. XX
  725. XX
  726. XX
  727. XX
  728. XVersion 3.70                    UW                              7
  729. XX
  730. XX
  731. XX
  732. XX
  733. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  734. XX
  735. XX
  736. XX
  737. XX          rcp-line -> [@@][%%][--][++] LLIINNEE
  738. XX
  739. XX
  740. XX          Attribute-Definition -> attrs :: targets
  741. XX
  742. XX
  743. XX          attribute -> ..EEPPIILLOOGG
  744. XX                    -> ..IIGGNNOORREE
  745. XX                    -> ..LLIIBBRRAARRYY
  746. XX                    -> ..MMKKSSAARRGGSS
  747. XX                    -> ..NNOOIINNFFEERR
  748. XX                    -> ..NNOOSSTTAATTEE
  749. XX                    -> ..PPHHOONNYY
  750. XX                    -> ..PPRREECCIIOOUUSS
  751. XX                    -> ..PPRROOLLOOGG
  752. XX                    -> ..SSEETTDDIIRR==_p_a_t_h
  753. XX                    -> ..SSIILLEENNTT
  754. XX                    -> ..SSEEQQUUEENNTTIIAALL
  755. XX                    -> ..SSWWAAPP
  756. XX                    -> ..UUSSEESSHHEELLLL
  757. XX                    -> ..SSYYMMBBOOLL
  758. XX                    -> ..UUPPDDAATTEEAALLLL
  759. XX
  760. XX          special-target -> ..EERRRROORR
  761. XX                         -> ..EEXXPPOORRTT
  762. XX                         -> ..GGRROOUUPPEEPPIILLOOGG
  763. XX                         -> ..GGRROOUUPPPPRROOLLOOGG
  764. XX                         -> ..IIMMPPOORRTT
  765. XX                         -> ..IINNCCLLUUDDEE
  766. XX                         -> ..IINNCCLLUUDDEEDDIIRRSS
  767. XX                         -> ..MMAAKKEEFFIILLEESS
  768. XX                         -> ..RREEMMOOVVEE
  769. XX                         -> ..SSOOUURRCCEE
  770. XX                         -> ..SSOOUURRCCEE.._s_u_f_f_i_x
  771. XX                         -> ._s_u_f_f_i_x_1._s_u_f_f_i_x_2
  772. XX
  773. XX
  774. XX     Where, TTAABB represents a <tab> character, SSTTRRIINNGG represents
  775. XX     an arbitrary sequence of characters, and LLIINNEE represents a
  776. XX     possibly empty sequence of characters terminated by a non-
  777. XX     escaped (not immediately preceded by a backslash '\') new-
  778. XX     line character.  MMAACCRROO, PPRREERREEQQUUIISSIITTEE, and TTAARRGGEETT each
  779. XX     represent a string of characters not including space or tab
  780. XX     which respectively form the name of a macro, prerequisite or
  781. XX     target.  The name may itself be a macro expansion expres-
  782. XX     sion.  A LLIINNEE can be continued over several physical lines
  783. XX     by terminating it with a single backslash character.  Com-
  784. XX     ments are initiated by the pound ## character and extend to
  785. XX     the end of line.  All comment text is discarded, a '#' may
  786. XX     be placed into the makefile text by escaping it with '\'
  787. XX     (ie. \# translates to # when it is parsed).  An exception to
  788. XX     this occurs when a # is seen inside a recipe line that
  789. XX
  790. XX
  791. XX
  792. XVersion 3.70                    UW                              8
  793. XX
  794. XX
  795. XX
  796. XX
  797. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  798. XX
  799. XX
  800. XX
  801. XX     begins with a <tab> or is inside a group recipe.  If you
  802. XX     specify the --cc command line switch then this behavior is
  803. XX     disabled and ddmmaakkee will treat all # characters as start of
  804. XX     comment indicators unless they are escaped by \.  A set of
  805. XX     continued lines may be commented out by placing a single #
  806. XX     at the start of the first line.  A continued line cannot
  807. XX     span more than one makefile.
  808. XX
  809. XX     wwhhiittee ssppaaccee is defined to be any combination of <space>,
  810. XX     <tab>, and the sequence \<nl> when \<nl> is used to ter-
  811. XX     minate a LINE.  When processing mmaaccrroo definition lines, any
  812. XX     amount of white space is allowed on either side of the macro
  813. XX     operator (=, *=, :=, *:=, += or +:=), and white space is
  814. XX     stripped from both before and after the macro value string.
  815. XX     The sequence \<nl> is treated as white space during recipe
  816. XX     expansion and is deleted from the final recipe string.  You
  817. XX     must escape the \<nl> with another \ in order to get a \ at
  818. XX     the end of a recipe line.  The \<nl> sequence is deleted
  819. XX     from macro values when they are expanded.
  820. XX
  821. XX     When processing ttaarrggeett definition lines, the recipe for a
  822. XX     target must, in general, follow the first definition of the
  823. XX     target (See the RULES AND TARGETS section for an exception),
  824. XX     and the recipe may not span across multiple makefiles.  Any
  825. XX     targets and prerequisites found on a target definition line
  826. XX     are taken to be white space separated tokens.  The rule
  827. XX     operator (_o_p in SYNTAX section) is also considered to be a
  828. XX     token but does not require white space to precede or follow
  829. XX     it.  Since the rule operator begins with a `:', traditional
  830. XX     versions of make do not allow the `:' character to form a
  831. XX     valid target name.  ddmmaakkee allows `:' to be present in
  832. XX     target/prerequisite names as long as the entire
  833. XX     target/prerequisite name is quoted.  For example:
  834. XX
  835. XX          a:fred : test
  836. XX
  837. XX     would be parsed as TARGET = a, PREREQUISITES={fred, :,
  838. XX     test}, which is not what was intended.  To fix this you must
  839. XX     write:
  840. XX
  841. XX          "a:fred" : test
  842. XX
  843. XX     Which will be parsed as expected.  See the EXAMPLES section
  844. XX     for how to apply "" quoting to a list of targets.
  845. XX
  846. XAATTTTRRIIBBUUTTEESS
  847. XX     ddmmaakkee defines several target attributes.  Attributes may be
  848. XX     assigned to a single target, a group of targets, or to all
  849. XX     targets in the makefile.  Attributes are used to modify
  850. XX     ddmmaakkee actions during target update.  The recognized attri-
  851. XX     butes are:
  852. XX
  853. XX
  854. XX
  855. XX
  856. XVersion 3.70                    UW                              9
  857. XX
  858. XX
  859. XX
  860. XX
  861. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  862. XX
  863. XX
  864. XX
  865. XX     ..EEPPIILLOOGG     Insert shell epilog code when executing a group
  866. XX                 recipe associated with any target having this
  867. XX                 attribute set.
  868. XX
  869. XX     ..IIGGNNOORREE     Ignore an error when trying to make any target
  870. XX                 with this attribute set.
  871. XX
  872. XX     ..LLIIBBRRAARRYY    Target is a library.
  873. XX
  874. XX     ..MMKKSSAARRGGSS    If running in an MSDOS environment then use MKS
  875. XX                 extended argument passing conventions to pass
  876. XX                 arguments to commands.  Non-MSDOS environments
  877. XX                 ignore this attribute.
  878. XX
  879. XX     ..NNOOIINNFFEERR    Any target with this attribute set will not be
  880. XX                 subjected to transitive closure if it is
  881. XX                 inferred as a prerequisite of a target whose
  882. XX                 recipe and prerequisites are being inferred.
  883. XX                 (i.e. the inference algorithm will not use any
  884. XX                 prerequisite with this attribute set, as a tar-
  885. XX                 get) If specified as '.NOINFER:' (ie. with no
  886. XX                 prerequisites or targets) then the effect is
  887. XX                 equivalent to specifying --TT on the command line.
  888. XX
  889. XX     ..NNOOSSTTAATTEE    Any target with this attribute set will not have
  890. XX                 command line flag information stored in the
  891. XX                 state file if .KEEP_STATE has been enabled.
  892. XX
  893. XX     ..PPHHOONNYY      Any target with this attribute set will have its
  894. XX                 recipe executed each time the target is made
  895. XX                 even if a file matching the target name can be
  896. XX                 located.  Any targets that have a .PHONY attri-
  897. XX                 buted target as a prerequisite will be made each
  898. XX                 time the .PHONY attributed prerequisite is made.
  899. XX
  900. XX     ..PPRREECCIIOOUUSS   Do not remove associated target under any cir-
  901. XX                 cumstances.  Set by default for any targets
  902. XX                 whose corresponding files exist in the file sys-
  903. XX                 tem prior to the execution of ddmmaakkee.
  904. XX
  905. XX     ..PPRROOLLOOGG     Insert shell prolog code when executing a group
  906. XX                 recipe associated with any target having this
  907. XX                 attribute set.
  908. XX
  909. XX     ..SSEEQQUUEENNTTIIAALL Force a sequential make of the associated
  910. XX                 target's prerequisites.
  911. XX
  912. XX     ..SSEETTDDIIRR     Change current working directory to specified
  913. XX                 directory when making the associated target.
  914. XX                 You must specify the directory at the time the
  915. XX                 attribute is specified.  To do this simply give
  916. XX                 _._S_E_T_D_I_R_=_p_a_t_h as the attribute.  _p_a_t_h is expanded
  917. XX
  918. XX
  919. XX
  920. XVersion 3.70                    UW                             10
  921. XX
  922. XX
  923. XX
  924. XX
  925. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  926. XX
  927. XX
  928. XX
  929. XX                 and the result is used as the value of the
  930. XX                 directory to change to.  If path is surrounded
  931. XX                 by single quotes then path is not expanded, and
  932. XX                 is used literally as the directory name.  If the
  933. XX                 _p_a_t_h contains any `:' characters then the entire
  934. SHAR_EOF
  935. true || echo 'restore of dm37p2 failed'
  936. fi
  937. echo 'End of  part 1'
  938. echo 'File dm37p2 is continued in part 2'
  939. echo 2 > _shar_seq_.tmp
  940. exit 0
  941.  
  942. exit 0 # Just in case...
  943. -- 
  944. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  945. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  946. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  947. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  948.